import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 邓大帅
 * Date: 2022-12-17
 * Time: 14:37
 */
public class Qualifying {
    public static void qualifying(int[] array) {
        int j = array.length - 1;
        int i = 0;
        while (i < j){
            if(((array[i] % 2) == 0) || ((array[j] % 2) != 0)) {
                int temp = array[i];
                array[i] = array[j];
                array[j] = temp;
            }
            i++;
            j--;
        }
    }
    public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4,5,6};
        qualifying(array);
        System.out.println(Arrays.toString(array));
    }
}
